package mo.tags.stack;

import java.util.ArrayList;
import java.util.List;

public class L1441 {

    public List<String> buildArray(int[] target, int n) {
        List<String> opList = new ArrayList<>();
        int len = target.length;
        int idx = 0;
        for (int i = 1; i <= n; i++) {
            opList.add("Push");
            if (target[idx] == i) {
                idx++;
            } else {
                opList.add("Pop");

            }
            if (idx == len) {
                break;
            }
        }
        return opList;
    }


    public static void main(String[] args) {
        L1441 test = new L1441();
        System.out.println(test.buildArray(new int[]{1, 2}, 4));
    }
}
